package com.example.demo.sys.common;

import org.apache.commons.lang3.StringUtils;

/**
 * 判断层级的工具类
 * Created by 蔡超 on 2018/10/7.
 */
public class LevelUtil {

    public static final String SEPARATOE = ".";//层级之间分隔符

    public static final Integer ROOT = 0;

    /**
    * @Description: 生成层级
    * @Param:
    * @return:
    * @Author: 蔡超
    * @Date: 2018/10/7 9:19
    */
    public static int calculateLevel(int level,String parentId){
        if(StringUtils.isBlank(parentId)){
            return ROOT;
        }else {
            return ROOT+1;
        }
    }


}
